package br.com.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Conexao {
	
	public static Connection getConnection() {
		Connection con = null;

		try {
			
			Class.forName("com.mysql.jdbc.Driver");//Força o carregamento do drive
			//referencia para um objeto de conexao
			con = DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/fj21",
					"root", "styles");
			
		//	System.out.println("Conectado!");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();

		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return con;
	}

}
